<script setup>
import { onMounted, ref } from "vue";
import { ElMessage } from "element-plus";
import axios from "axios";
import http from "../../http";
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route = useRoute()

let name = ref("")
let status = ref('')
const addworkflow=()=>{
    console.log(name.value,status.value)
    if(name.value==''||status.value==''){
        ElMessage.error('请输入完整信息')
    }
    else{
        router.push({path:'/addworkflow2'})
        localStorage.setItem('workflow_name',name.value)
        localStorage.setItem('workflow_status',status.value)
    }
    
}

</script>

<template>
    <div style="height: 550px;padding: 10px 20px; ">
        <h1 style="font-size: 24px;">添加工作流</h1>
    <el-card class="box-card">
        <h3>工作流名称</h3>
        <el-input v-model="name" placeholder="请输入工作流名称" style="width: 260px;" />
    </el-card>
    <el-card class="box-card">
        <h3>是否可用</h3>
        <el-radio-group v-model="status">
            <el-radio label="是" value="1">可用</el-radio>
            <el-radio label="否"value="2">停用</el-radio>
        </el-radio-group>
    </el-card>
    <el-button  @click="addworkflow" style="position: absolute;margin-top: 20px;left: 50%;margin-left: 330px;font-size: 16px;">下一步</el-button>
    </div>
</template>

<style scoped>

.box-card {
   width: 600px;
   margin: auto;
   margin-top: 20px;
   height: 150px;
 }
 .el-button {
  color: #000; /* 白色字体 */
  border: none;
  border-radius: 4px;
  cursor: pointer; /* 指针鼠标样式 */
}

</style>